package top.zsyle.movie.exception;

import lombok.Getter;

@Getter
public enum GlobalExceptionEnum {
    OK("1","操作成功！"),
    ERROR("-1","系统异常！"),
    PARAM_IS_NULL_EXCEPTION("2","空参数异常！"),
    PARAM_VALIDATION_EXCEPTION("3", "参数校验异常！"),
    //10XXX 开头的为 system 服务异常码

    //20XXX 开头的为 movie 服务异常码
    MOVIE_TICKET_IS_NULL_EXCETRION("20001","电影票已经售罄了"),
    MOVIE_SERVICE_ERROR("20002","movie服务异常！"),
    MOVIE_GET_LIST_EXCEPTION("20003","服务熔断，movie服务获取列表异常！"),
    MOVIE_GET_BY_ID_EXCEPTION("20004","服务熔断，movie服务通过Id获取异常！"),
    MOVIE_ADD_OR_UPDATE_MIDDLE_EXCEPTION("20005","服务熔断，添加或修改中间表失败！"),
    MOVIE_TICKET_IS_NOT_ENOUGH_EXCEPTION("20006","电影票不足，请少量购买！"),
    MOVIE_SAVE_OR_UPDATE_EXCEPTION("20007","服务熔断，添加或修改电影票失败！"),
    MOVIE_USER_IS_EXIST_TICKET_EXCEPTION("20008","服务熔断，该用户没有电影票！"),
    MOVIE_TICKET_IS_NULL_EXCEPTION("20009","该用户没有电影票！"),
    MOVIE_TICKET_IS_USED_EXCEPTION("20010","电影票已经被使用！"),
    MOVIE_TICKET_IS_OVER_TIME_EXCEPTION("20011","电影票已经过期了！"),
    MOVIE_TICKET_IS_NOT_EXIST_EXCEPTION("20012","没有有效的电影票存在！"),

    //30XXX 开头的为 user 服务异常码
    USER_BALANCE_IS_NOT_ENOUGH_EXCEPTION("30001","用户余额不足！"),



    ;



    private String code;

    private String message;

    GlobalExceptionEnum(String code,String message) {
        this.message = message;
        this.code = code;
    }
}
